/**
 * 
 */
package net.sahv.bdyz.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import net.sahv.bdyz.mapper.OrdersListMapper;
import net.sahv.bdyz.model.OrdersList;
import net.sahv.bdyz.util.PageInfo;


@Service
public class OrdersListService {

	@Autowired
	private OrdersListMapper ordersListMapper;

	public int deleteByPrimaryKey(Integer oId) {
		return ordersListMapper.deleteByPrimaryKey(oId);
	}

	public int insert(OrdersList record) {
		return ordersListMapper.insert(record);
	}

	public OrdersList selectByPrimaryKey(Integer oId) {
		return ordersListMapper.selectByPrimaryKey(oId);
	}

	public List<OrdersList> selectAll() {
		return ordersListMapper.selectAll();
	}

	public int updateByPrimaryKey(OrdersList record) {
		return ordersListMapper.updateByPrimaryKey(record);
	}

	
	public List<Map<String, Object>> findAll(PageInfo pageInfo, String where, String order) {
		Map<String, Object> param = new HashMap<String, Object>();
		param.put("myCount", pageInfo.getCount());
		param.put("pageSize", pageInfo.getPageSize());
		param.put("page", pageInfo.getPage());
		param.put("where", where);
		param.put("order", order);
		List<Map<String, Object>> m = ordersListMapper.findAll(param);
		pageInfo.setCount(Integer.parseInt(param.get("myCount").toString()));
		return m;
	}

	public List<Map<String, Object>> selectAllByOrdersId(Integer oId,String yuyan) {
		return ordersListMapper.selectAllByOrdersId(oId,yuyan);
	}

	public int deleteByoId(Integer oId) {
		return ordersListMapper.deleteByoId(oId);
		
	}

}
